#include <stdio.h>

namespace sg
{

	#define SEX_MALE 1
	#define SEX_FEMALE 2

	class Person 
	{
	public :
		Person(){printf("Person()\n");}
		Person(int age){this->age=age;}
		~Person(){printf("~Person()\n");}
		//virtual ~Person(){printf("~Person()\n");}
		void ShowAge(){printf("Age is %d\n",this->age);}
		void ShowSex();
		void SetAge(int age){this->age=age;}
		void SetSex(int sex){this->sex=sex;}
	protected :
		int age;
		int sex;
	private :
		int privated;
	};

	void Person::ShowSex()
	{
		printf("Sex is %d\n",this->sex);
	}

	class Male : public Person
	{
	public :
		Male(){this->sex=SEX_MALE;}
		Male(int age) : Person(age)
		{}
		~Male(){printf("~Male()\n");}
		void LikePlayingPS3()
		{
			printf("Male Like Playing PS3\n");
		}
	};

	class FeMale : public Person
	{
	public :
		FeMale(){this->sex=SEX_FEMALE;}
		~FeMale(){printf("~FeMale()\n");}
		void LikeYoga()
		{
			printf("FeMale Like Yoga\n");
		}
	};

}

int main()
{
	// parent class Person
	sg::Person person;
	person.SetAge(24);
	person.SetSex(SEX_MALE);
	person.ShowAge();
	person.ShowSex();

	printf("----------------------------------\n");

	// child class Male & FeMale
	sg::Male male;
	male.SetAge(24);
	male.SetSex(SEX_MALE);
	male.ShowAge();
	male.ShowSex();

	male.LikePlayingPS3();

	printf("----------------------------------\n");

	sg::FeMale female;
	female.SetAge(24);
	female.SetSex(SEX_MALE);
	female.ShowAge();
	female.ShowSex();
	
	female.LikeYoga();

	return 0;
}







